export const searchToObj = search => {
  // let ret = {}
  // search = search.startsWith('?') ? search.slice(1) : search
  // search.split('&').forEach(item => {
  //   let [key, value] = item.split('=')
  //   ret[key] = value
  // })
  // return ret
  // search = new URLSearchParams(search)
  // return Object.fromEntries(search.entries())

  return Object.fromEntries(new URLSearchParams(search).entries())
}
